package ca.usask.cs.decisiontree.api;


/**
 * An IntermediateTreeNode is a TreeNode that may also have children connected by Edges.
 *
 * @author SaskTrav
 */
public interface EventNodeInterface extends IntermediateTreeNode {


	
	/**
     * Adds an Edge to this node to connect a child. Change the childToAdd's
     * probability to probability. If the Edge already exists
     * in the node, do nothing.
     *
     * Throws exception if:
     *          - the Edge's sourcce is not the current node.
     *          - the Edge's destination is equal to the current node
     *          - the Edge's destination is equal to null
     *          - the Edge is null
     *
     *
     * @postcondition iterator returned from getChildren will contain childToAdd
     *
     * @param childToAdd An Edge to be added to this node
     * @return
     */
    public boolean addChildEdge(Edge childToAdd, double probability);

    /**
     * retrieves the sum of all Probabilities of all child Edge's
     * @return
     */
    public double getTotalProbability();

    /**
     * returns true if the total probability of the ChanceEdges is 1.0
     *         false otherwise
     * @return
     */
    public boolean isValidTotalProbability();

}
